package quinn.web;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import quinn.web.server.CtrlPowerDao;


public class MainServlet extends HttpServlet{
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		//super.doGet(req, resp);
		req.setCharacterEncoding("UTF-8"); 
		System.out.println("MainServlet do get");
		CtrlPowerDao ctrlPowerDao = new CtrlPowerDao(getServletContext().getRealPath("/WEB-INF/")+"conf/");
		System.out.println(ctrlPowerDao.getPcName());
		req.setAttribute("pcNames", ctrlPowerDao.getPcName());
		req.getRequestDispatcher("/main.jsp").forward(req, resp);
		return;
	}
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		//super.doPost(req, resp);
	}
}
